load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "throttler",
    srcs = [
        "local.go",
        "service.go",
        "throttle.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/throttler",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/cache",
        "//pkg/util/log",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "throttler_test",
    srcs = [
        "local_test.go",
        "throttle_test.go",
    ],
    embed = [":throttler"],
    deps = [
        "//pkg/util/timeutil",
        "@com_github_stretchr_testify//require",
    ],
)
